<template>
	<view>
		<view class="myTop">
			<view class="topLeft">
				<image :src="info.avatar" mode=""></image>
			</view>
			<view class="topRight">
				<view>{{info.nickname}}</view>
				<view class="topName">推荐人：<text>
				{{info.p_name?info.p_name:'无'}}</text></view>
				<view class="topRights">{{info.agent_lv}}</view>
			</view>
		</view>
		<!-- <view class="shareId">
			<image src="../../static/logo.png" mode=""></image>我的ID：123456
		</view> -->
		
		<view class="vipIncome">
			<!-- <view class="myMoney display">
				<view class="moneyList" @tap="goMingxi(1)">
					<view class="top">{{info.money}}</view>
					<view class="topName">我的钱包</view>
				</view>
				<view class="moneyList"  @tap="goMingxi(3)">
					<view class="top">{{info.red_num}}</view>
					<view class="topName">我的红包</view>
				</view>
				<view class="moneyList"  @tap="goMingxi(2)">
					<view class="top">{{info.red_money}}</view>
					<view class="topName">红包券</view>
				</view>
				<view class="moneyList" @tap= 'goJifen'>
					<view class="top">{{info.score}}</view>
					<view class="topName">我的积分</view>
				</view>
			</view> -->
			
			<view class="incomeTops">
				<view class="incoVip">
					<view class="vipNumber">{{info.money}}</view>
					<view class="vipGet ft_12">当前小潜</view>
				</view>
				<view class="display">
					<!-- <view class="drawalLeft ft_12" @tap="goXian">转换成现金</view> -->
					<view class="drawal" @tap="goDist">提现</view>
				</view>
				
			</view>
			<view class="incomeTops" >
				<view class="incoBox">
					<view class="vipNumber" >{{info.score}}</view>
					<view class="vipGet ft_12" >当前大潜</view>
				</view>
				<view class="display">
					<view class="drawalLeft ft_12 coloA" @tap="goRed">转账</view>
					<view ></view>
				</view>
				
			</view>
		</view>
		<view class="teamBox">
			<view class="boxLeft" @tap="goTeam">
				<image src="../../static/team.png" mode=""></image>
				<view class="myTeam">我的团队</view>
				<!-- <view class="myTeam" style="font-size: 12px;color: #999999;">{{userInfo.group}}人</view> -->
			</view>
			<view class="boxLeft" @tap="goYong">
				<image src="../../static/benfit.png" mode=""></image>
				<view class="myTeam">分销明细</view>
				<!-- <view class="myTeam" style="font-size: 12px;color: #999999;">{{userInfo.group}}人</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userinfo:{},
				shouy:{},
				info:{},
				userInfo:{},
				price:{},
				income:'',
				month:''
			}
		},
		onShow() {
			// this.getUserinfo()
			
			this.dist()
			this.getInfo()
			this.userMouth()
		},
		methods: {
			dist(){
				this.$myRequest({
					url: 'api/user/index',
					method:'POST',
				}).then(res => {
					if(res.data.code==1){
						// this.$all.setData('userInfo',res.data.data.info)
						this.userInfo=res.data.data.info
						this.price = res.data.data.price
					}
				})
			},
			userMouth(){
				// this.$myRequest({
				// 	url: 'api/user/user_month_reward',
				// 	method:'POST',
				// }).then(res => {
				// 	if(res.data.code==1){
				// 		this.month = res.data.data
				// 	}
				// })
			},
			getInfo(){
				this.$myRequest({
					url: 'api/user/index',
					method:'POST',
				}).then(res => {
					console.log(res.data);
					if(res.data.code==1){
						let data=res.data.data
						this.info = data.info
					}
				})
			},
			goMingxi(e){//明细
				uni.navigateTo({
					url:'mingxi?type='+e
				})
			},//积分明细
			goJifen(){
				uni.navigateTo({
					url:'jifenDetail'
				})
			},
			myDetail(){
				uni.navigateTo({
					url:'profitDetails'
				})
			},
			goDist(){
				uni.navigateTo({
					url:'drawMoney'
				})
			},
			goTeam(){
				uni.navigateTo({
					url:'myTeam'
				})
			},
			goYong(){
				uni.navigateTo({
					url:'disribution/disribution'
				})
			},
			goXian(){
				uni.navigateTo({
					url:'redToMoney'
				})
			},
			goRed(){
				uni.navigateTo({
					url:'moneyToRed'
				})
			}
		}
	}
</script>

<style lang="scss">
page{
	background-color: #FAFAFA;
}
.myTop{
		height: 200rpx;
		background: rgba(220, 149, 55, 0.39);
		opacity: 1;
		display: flex;
		padding-left: 16px;
		color: #fff;
		.topLeft{
			line-height: 200rpx;
			image{
				width:120rpx;
				height: 120rpx;
				border-radius: 50%;
				vertical-align: middle;
			}
		}
		.topRight{
			width: 55%;
			margin: 52rpx 0 0 32rpx;
			font-size:14px;
			.topName{
				font-size: 11px;
				line-height: 16px;
				color: #FFFFFF;
				margin-bottom: 10px;
			}
		}
		.topRights{
			width: 57px;
			height: 20px;
			border: 1px solid #FFFFFF;
			opacity: 1;
			border-radius: 14px;
			font-size: 11px;
			font-family: PingFang SC;
			font-weight: 500;
			line-height: 20px;
			color: #FFFFFF;
			text-align: center;
		}
	}
	.shareId{
		height: 100rpx;
		background: #FFFFFF;
		margin: 20rpx 0;
		line-height: 100rpx;
		font-size: 14px;
		color: #000000;
		image{
			height: 40rpx;
			width: 40rpx;
			vertical-align: middle;
			margin:0 20rpx 0 30rpx;
		}
	}
	.vipIncome{
		background-color: #fff;
		// height: 340rpx;
		
		.incomeTops{
			width: 90%;
			margin: auto;
			padding: 40rpx 0;
			// height: 85px;
			border-bottom: 1px solid #fafafa;
			font-size: 20px;
			line-height: 24px;
			display: flex;
			justify-content: space-between;
			.drawalLeft{
				margin-right: 40rpx;
				border: 1px solid #FF9101;
				border-radius: 14px;
				color: #FF9101;
			}
			.coloA{
				border: 1px solid #A80000;
				color: #A80000;
			}
			.coloB{
				background: #A80000!important;
			}
			.drawal{
				background: #FF9101;
				border-radius: 14px;
				color: #fff;
			}
			.drawal,.drawalLeft{
				font-size: 12px;
				
				width: 75px;
				height: 28px;
				line-height: 28px;
				text-align: center;
			}
		}
	}
	.teamBox{
		height: 87px;
		background: #FFFFFF;
		display: flex;
		justify-content: space-between;
		margin-top: 20rpx;
		// text-align: center;
		.boxLeft{
			width: 50%;
			position: relative;
			padding-top: 50rpx;
			image{
				position: absolute;
				width: 48rpx;
				height: 48rpx;
				left: 92rpx;
				top: 56rpx;
			}
			.myTeam{
				margin-left: 160rpx;
				font-size: 14px;
				line-height: 20px;
				color: #666666;
			}
		}
	}
	.vipTop{
		width: 90%;
		margin: auto;
		// padding: 40rpx 0;
		border-bottom: 1px solid #F2F2F2;
		padding-top:20px;
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;
		.topBox{
			width: 30%;
			margin-bottom: 20px;
		}
	}
	.vipNumber{
		
		font-size: 20px;
		font-family: DIN;
		font-weight: 500;
		line-height: 24px;
		color: #333333;
	}
	.vipGet{
		font-size: 12px;
		font-family: PingFang SC;
		font-weight: 500;
		line-height: 17px;
		color: #000000;
	}
	.myMoney{
		width: 100%;
		background-color: #fff;
		border-radius: 16rpx;
		height: 176rpx;
		text-align: center;
		justify-content: space-between;
		margin-top: 20rpx;
		.moneyList{
			width: 20%;
			text-align: center;
			font-size: 12px;
			font-weight: 500;
			color: #666666;
			.top{
				font-size: 24px;
				font-family: Arial-Bold, Arial;
				font-weight: bold;
				color: #333333;
			}
		}
	}
</style>
